package 函数式接口.四大函数式接口;

import java.util.function.Supplier;

public class MySupplier {

    public static void main(String[] args) {
        method(new Supplier<String>() {
            @Override
            public String get() {
                return "hello";
            }
        });

        method(() -> "hello");
    }


    public static void method(Supplier<String> supplier) {
        String s = supplier.get();
        System.out.println(s);
    }
}
